﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace SnelsteRoute
{
    public class Models : INotifyPropertyChanged
    {
        #region Singleton

        private static Models _instance;

        private Models()
        {
            
        }

        public static Models GetInstance()
        {
            if (_instance == null)
                _instance = new Models();

            return _instance;
        }

#endregion

        private Int32 _loadingProgress = 0;
        public Int32 LoadingProgress {
            get { return _loadingProgress; }
            set { _loadingProgress = value;
                NotifyPropertyChanged("LoadingProgress");
            }
        }

        private Int32 _locatedRoutes = 0;
        public Int32 LocatedRoutes
        {
            get { return _locatedRoutes; }
            set
            {
                _locatedRoutes = value;
                NotifyPropertyChanged("LocatedRoutes");
            }
        }

        private Int32 _finishedRoutes = 0;
        public Int32 FinishedRoutes
        {
            get { return _finishedRoutes; }
            set
            {
                _finishedRoutes = value;
                NotifyPropertyChanged("FinishedRoutes");
            }
        }

        private Int32 _scanIndex = 0;
        public Int32 ScanIndex
        {
            get { return _scanIndex; }
            set
            {
                _scanIndex = value;
                NotifyPropertyChanged("ScanIndex");
            }
        }

        private String _activity ;
        public String Activity
        {
            get { return _activity; }
            set
            {
                _activity = value;
                NotifyPropertyChanged("Activity");
            }
        }

        private List<Configuration> _configurations;
        public List<Configuration> Configurations
        {
            get { return _configurations; }
            set
            {
                _configurations = value;
                NotifyPropertyChanged("Configurations");
            }
        }

        private Configuration _selectedConfiguration;
        public Configuration SelectedConfiguration
        {
            get { return _selectedConfiguration; }
            set
            {
                _selectedConfiguration = value;
                NotifyPropertyChanged("SelectedConfiguration");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName = "")
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
